defaultvalue: Stop warnings via new g_object_ref()
authorDaniel Boles <dboles.src@gmail.com>
Fri, 29 Jun 2018 17:38:15 +0000 (18:38 +0100)
committerDaniel Boles <dboles.src@gmail.com>
Fri, 29 Jun 2018 17:46:09 +0000 (18:46 +0100)
Now that it can propagate the type, we must explicitly cast to GObject*
to assign it, otherwise gcc shouts.

testsuite/gtk/defaultvalue.c

index 0cc445f0cc9abc272c481747035698fe9b8c0d61..05f176f950c5120698a3fabf82fce9b4bbfe79cd 100644 (file)
@@ -104,7 +104,7 @@ test_type (gconstpointer data)
   klass = g_type_class_ref (type);
 
   if (g_type_is_a (type, GTK_TYPE_SETTINGS))
-    instance = g_object_ref (gtk_settings_get_default ());
+    instance = G_OBJECT (g_object_ref (gtk_settings_get_default ()));
   else if (g_type_is_a (type, GDK_TYPE_WINDOW))
     {
       GdkWindowAttr attributes;
@@ -113,7 +113,7 @@ test_type (gconstpointer data)
       attributes.event_mask = 0;
       attributes.width = 100;
       attributes.height = 100;
-      instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
+      instance = G_OBJECT (g_object_ref (gdk_window_new (NULL, &attributes, 0)));
     }
   else if (g_str_equal (g_type_name (type), "GdkX11Cursor"))
     instance = g_object_new (type, "display", display, NULL);